<template>
  <a-config-provider
    :locale="zhCN"
    :theme="{
      token: {
        colorPrimary: colorPrimary,
      },
      algorithm: theme.darkAlgorithm,
    }"
  >
    <RouterView />
  </a-config-provider>
</template>

<script lang="ts" setup>
import { RouterView } from 'vue-router'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { theme } from 'ant-design-vue'

// 获取 CSS 主题
const colorPrimary = getComputedStyle(document.documentElement)
  .getPropertyValue('--color-primary')
  .trim()

dayjs.locale('zh-cn')
</script>

<style scoped lang="less"></style>
